<div class="modal-header">
  <div class="modal-title">{{user.id ? '编辑' : '添加'}}-用户</div>
</div>
<form (ngSubmit)="save()" nz-form>

  <nz-form-item>
    <nz-form-label nzXs="24" nzSm="7" nzFor="name" nzRequired>姓名</nz-form-label>
    <nz-form-control nzXs="24" nzSm="12" nzMd="10">
      <input nz-input [(ngModel)]="user.name" name="name" placeholder="请输入姓名" id="aname">
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-label nzXs="24" nzSm="7" nzFor="username" nzRequired>账户</nz-form-label>
    <nz-form-control nzXs="24" nzSm="12" nzMd="10">
      <input nz-input [readonly]="user.id" [(ngModel)]="user.username" name="username" placeholder="请输入账户" id="username">
    </nz-form-control>
  </nz-form-item>
  <nz-form-item *ngIf="!user.id">
    <nz-form-label nzXs="24" nzSm="7" nzFor="password" nzRequired>密码</nz-form-label>
    <nz-form-control nzXs="24" nzSm="12" nzMd="10">
      <input nz-input type="password" [(ngModel)]="user.password" name="password" placeholder="请输入密码" id="password">
    </nz-form-control>
  </nz-form-item>    
  <nz-form-item>
    <nz-form-label nzXs="24" nzSm="7" nzFor="description">备注</nz-form-label>
    <nz-form-control nzXs="24" nzSm="12" nzMd="10">
      <textarea nz-input [(ngModel)]="user.description" name="description" maxlength="120" id="description"></textarea>
    </nz-form-control>
  </nz-form-item>

  <div class="modal-footer">
    <button nz-button type="button" (click)="close()">关闭</button>
    <button nz-button [nzLoading]="loading" [nzType]="'primary'">保存</button>
  </div>
</form>



